package gui.Packaging;

import gui.mpm.MPMFrame;

import java.awt.Dimension;
import java.awt.Toolkit;
import java.util.ArrayList;

import javax.swing.JFrame;
import javax.swing.UIManager;

import clients.RPCClient;
import java.awt.SystemColor;
import java.awt.Color;
/**
 * 
 * @author adam
 *Packaging main frame , initializes the main panel .
 */
public class PackagingFrame extends JFrame {
	
	public static RPCClient myPackagingCleint = null;
	private JTappedPanePackagingMain myJTabbedPanelJTappedPanePackagingMain ;
	
	public PackagingFrame()
	{
		getContentPane().setBackground(new Color(173, 216, 230));
		

	}
	/**
	 * Main !
	 * @param args
	 */
	 public static void main(String[] args) {
		 try {
			 
	            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
	                if ("Nimbus".equals(info.getName())) {
	                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
	                    break;
	                }
	            }
	        } catch (ClassNotFoundException ex) {
	            java.util.logging.Logger.getLogger(MPMFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
	        } catch (InstantiationException ex) {
	            java.util.logging.Logger.getLogger(MPMFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
	        } catch (IllegalAccessException ex) {
	            java.util.logging.Logger.getLogger(MPMFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
	        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
	            java.util.logging.Logger.getLogger(MPMFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
	        }
		 
		 try
         {
			 myPackagingCleint = new RPCClient();
             if  (myPackagingCleint== null)
          	   System.exit(0);
          //  System.out.println("Client connection is up and ready.");

            // get list of orders
        }
        catch  (Exception e) 
        {
          //e.printStackTrace();
        }
		 
		 PackagingFrame myPackagingFrame = new PackagingFrame();
		 myPackagingFrame.myJTabbedPanelJTappedPanePackagingMain = new JTappedPanePackagingMain(myPackagingFrame);
		 myPackagingFrame.setContentPane(myPackagingFrame.myJTabbedPanelJTappedPanePackagingMain);
		 //myPackagingFrame.setMinimumSize(new Dimension(400,400));
		 Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
		 myPackagingFrame.setLocation(dim.width/2-myPackagingFrame.getSize().width/2, dim.height/2-myPackagingFrame.getSize().height/2);
		 myPackagingFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		 myPackagingFrame.setIconImage(Toolkit.getDefaultToolkit().getImage(MPMFrame.class.getResource("/graphics/Spearhead.png")));
	     myPackagingFrame.setTitle("ח.נ.י.ת");
		 myPackagingFrame.setLocationRelativeTo(null);
		 myPackagingFrame.setVisible(true);
		 myPackagingFrame.pack();
		 myPackagingFrame.setExtendedState(javax.swing.JFrame.MAXIMIZED_BOTH);
 
    }


	 
	 
	 
	 
	 
	 
	 
	 
}
